package com.sline.ThreadMethod;

public class Demo1_Name {
    public static void main(String[] args) {
        // demo1();

        new Thread("第一线程") {
            public void run() {
                this.setName("xxx");
                System.out.println(this.getName() + " aaaaa");
            }
        }.start();
        new Thread("第二线程") {
            public void run() {
                this.setName("yyy");
                System.out.println(this.getName() + " bbbbb");
            }
        }.start();
    }

    private static void demo1() {
        new Thread("第一线程") {
            public void run() {
                System.out.println(this.getName() + " aaaaa");
            }
        }.start();
        new Thread("第二线程") {
            public void run() {
                System.out.println(this.getName() + " bbbbb");
            }
        }.start();
    }
}
